extends CharacterBody2D

func _ready() -> void:
	if str(multiplayer.get_unique_id()) == name :
		get_tree().current_scene.myself = self

func _process(_delta: float) -> void:
	var h = Input.get_axis("ui_left","ui_right")
	var v = Input.get_axis("ui_up","ui_down")
	var dir = Vector2(h,v).normalized()
	if dir.length() > 0.0 :
		rpc("_move",dir)

func _physics_process(_delta: float) -> void:
	move_and_slide()
	velocity = Vector2.ZERO

@rpc("any_peer")
func _move(_dir : Vector2) -> void : pass
